<?php
if(!empty($_POST["de"]))
{
	$id=implode(",",$_POST["de"]);
	if($_POST["action"]==lang_show('delete'))
		$sql="delete from ".ZP." where id in ($id)";
	if($_POST["action"]==lang_show('rc'))
		$sql="update ".RESUME." SET statu=2 where rid in ($id)";
	$db->query($sql);
	unset($sql);
}

if(!empty($_GET['id'])){
    $sql="update ".RESUME." SET statu=2 where rid =".$_GET['id'];
    $db->query($sql);
	unset($sql);
}
if(!empty($_GET['qid'])){
    $sql="update ".RESUME." SET statu=1 where rid =".$_GET['qid'];
    $db->query($sql);
	unset($sql);
}
if(!empty($_GET['did'])){
    $sql="delete from ".RESUME." where rid =".$_GET['did'];
    $db->query($sql);
	unset($sql);
}
?>
<HTML>
<HEAD>
<TITLE><?php echo lang_show('admin_system');?></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<link href="main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="main.js"></script>
</HEAD>
<body>
<div class="guidebox"><?php echo lang_show('system_setting_home');?> &raquo; <?php echo lang_show('hr_info_manager');?></div>
<div style="float:left; height:50px; width:50%;">&nbsp;</div>
<form action="" method="post">
<div class="bigbox">
	<div class="bigboxhead">简历管理</div>
	<div class="bigboxbody">
  <table width="100%" border="0" cellpadding="2" cellspacing="0">
      <tr> 
      <td ><input onClick="do_select();" type="checkbox" name="checkbox" value="checkbox"></td>
      <td >姓名</td>
      <td >简历名称</td>
      <td >更新时间</td>
      <td >状态</td>
      <td align="center" >管理</td>
      </tr>
    <?php
	$sql=NULL;

	$sql="SELECT a.*,b.name as uname FROM ".RESUME." as a inner join ".ALLUSER." as b on(a.userid=b.userid) where 1 ORDER BY rid DESC";
		//=============================
		include_once("../includes/page_utf_class.php");
	  	$page = new Page;
		$page->listRows=20;
		if (!$page->__get('totalRows')){
			$db->query($sql);
			$page->totalRows = $db->num_rows();
		}
        $sql .= "  limit ".$page->firstRow.",20";
		$pages = $page->prompt();
		//==================================
	$db->query($sql);
	$re=$db->getRows();
	$count_num=count($re);
	for($i=0;$i<$count_num;$i++)
	{
	?> 
         <tr  onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this,'odd')"> 
         <td width="49"><input type="checkbox" name="de[]" value="<?php echo $re[$i]["rid"]; ?>"></td>
         <td width="209"><?php echo $re[$i]["uname"];?></td>
         <td width="338" align="left"><?php echo $re[$i]["name"]; ?></td>
         <td width="230" align="left"><?php echo $re[$i]["time"]; ?></td>
         <td width="57" align="left"><?php if($re[$i]["statu"]==1){echo "审核通过";}elseif($re[$i]["statu"]==2){echo "推荐";} ?></td>
         <td width="116" align="center"> 
         <?php if($re[$i]["statu"]==1){?>
             <a href="module.php?m=job&s=resume_list.php&id=<?php echo $re[$i]["rid"]; ?>">推荐</a> 
         <?php }elseif($re[$i]["statu"]==2){?>
         <a href="module.php?m=job&s=resume_list.php&qid=<?php echo $re[$i]["rid"]; ?>">取消</a> 
         <?php }?>
         <a href="module.php?m=job&s=resume_list.php&did=<?php echo $re[$i]["rid"]; ?>">删除</a>
         </td>
        </tr>
	<?php 
    }
	?>
	 <tr>
	   <td colspan="3">
	   <input onClick="return confirm('<?php echo lang_show('are_you_sure');?>');" class="btn" type="submit" name="action" value="<?php echo lang_show('delete');?>">
	   <input class="btn" type="submit" name="action" value="<?php echo lang_show('rc');?>" onClick="return confirm('<?php echo lang_show('are_you_sure');?>');">	   </td>
	   <td colspan="3" align="right"><div class="page"><?php echo $pages?></div></td>
	 </tr>
  </table>
  </div>
</div>
</form>
</body>
</html>
